<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Array对象</title>
</head>
<body>
    <script>
        // 方式一：
        var array=new Array(1,2,465,7,8,45,4);

        console.log(typeof array)
        for (let i = 0; i < array.length; i++) {
            console.log(array[i]);
        }

        console.log(array)

        console.log("------------------------")

        // 方式二：
        var array02=[12,3,4,6,8];
        array02[5]=666;
        array02.push("张三");
        array02.splice(0,2);
        console.log(typeof array02)
        for (let i = 0; i < array02.length; i++) {
            console.log(array02[i]);
        }

        console.log(array02)
    </script>
</body>
</html>